#include<stdio.h>
#include<stdlib.h>


int main(void)
{
  int n = 1;
  int prime;
  FILE *primes = fopen("primes1000000", "r");
  if(!primes) {
    fprintf( stderr, "File open error\n");
    exit(1);
  }

  while( n < 100000) {
    fscanf(primes, "%d", &prime);
    printf("prime %d\n", prime);
    n *= prime;
  }
  printf("%d\n", n);

  return 0;
}
